package com.homework;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/27 19:39
 * @description
 */
public class T9 {
    public static void main(String[] args) {
        String str1 = "qwerabcdtyuiop";
        String str2 = "xcabcdvbn";

        for (int i = str2.length(); i > 0; i--) {
            for (int j = 0; j <= str2.length() - i; j++) {
                String substring = str2.substring(j, j + i);
                if (str1.contains(substring)) {
                    System.out.println("最大子串："+substring);
                    return;
                }
            }
        }
    }
}
